Repository navigation
Conversation
|
We should just eliminate We should remove (with the old one still deprecated) |
|
|
||
| /** Event emitted when the drawer is fully opened. */ | ||
| @Output('open') onOpen = new EventEmitter<MdDrawerToggleResult | void>(); | ||
| @Output() openChange = new EventEmitter<MdDrawerToggleResult | void>(); |
There was a problem hiding this comment.
I think this is really confusing now. I would expect openChange to fire when the drawer closes, since that is a change in the open state of the drawer. If we're going with this naming style we should get rid of the closeChange one and just emit booleans on the openChange stream whenever the drawer opens or closes.
We should also make it match the input (either both open or both opened) so that people can do 2-way binding
|
@jelbourn - I've removed @mmalerba - The input for open is |
|
+1 for changing emitted type to boolean. I think the @Input('open') isOpen = false;
@Output() openChange = new EventEmitter<boolean>();
open() { ... }or @Input() opened = false;
@Output() openedChange = new EventEmitter<boolean>();
open() { ... }I'm fine with either |
|
I generally prefer emitting event objects instead of primitives because we can always add more information to them later without it being a breaking change. So it would emit something like I'd rather avoid doing |
|
@jelbourn Agreed about I also agree about emitting events in most cases, but not when there's a corresponding |
|
@jelbourn and I talked offline and agreed on the following: @Input() opened: boolean;
@Output() openedChange: EventEmitter<boolean>;
@Output('opened') get _openedStream(): EventEmitter<void> { return filter(this.openedChange, o => o); }
@Output('closed') get _closedStream(): EventEmitter<void> { return filter(this.openedChange, o => !o); }
open() {...} |
|
Given all the changes, I'm closing this and starting fresh w/ #7450 |
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Updates APIs per #6677
open|onOpentoopenChangeclose|onClosetocloseChange@jelbourn -
onPositionChangedis a member declared withpositionChangedoutput name. We might consider changing that member name to match the output name in this as well.